#include <stdio.h>  
#include <string.h>  
#include <math.h>  
int a[15];  
  
void output(int max, int min, int ans, char opt) {  
    if (max < 0)  
        printf("(%d) ", max);  
    else  
        printf("%d ", max);  
    printf("%c ", opt);  
    if (min < 0)  
        printf("(%d) ", min);  
    else  
        printf("%d ", min);  
    printf("= %d\n", ans);  
  
}  
  
int main() {  
    int max = -2147483648, min = 2147483647, temp = 0, cnt = -1;  
    int flag = 0;  
    char c;  
    while (1) {  
        if (scanf("%c", &c));  
        if (c == '-') {  
            if (scanf("%c", &c));  
            if (c == ',') {  
                output(max, min, max - min, '-');  
                return 0;  
            }  
            flag = 1;  
        }  
        if (c >= '0' && c <= '9') {  
            a[++cnt] = c - '0' + 0;  
            continue;  
        }  
        switch (c) {  
            case ',':  
                temp = 0;  
                for (int i = cnt; i > -1 && a[i] >= 0 && a[i] <= 9; i--)  
                    temp += pow(10, cnt - i) * a[i];  
                if (flag == 1) {  
                    temp *= -1;  
                    flag = 0;  
                }  
                max = max > temp ? max : temp;  
                min = min < temp ? min : temp;  
                cnt = -1;  
                continue;  
            case '+':  
                output(max, min, max + min, '+');  
                return 0;  
            case '-':  
                output(max, min, max - min, '-');  
                return 0;  
            case '*':  
                output(max, min, max * min, '*');  
                return 0;  
            case '/':  
                if (min == 0)  
                    printf("Error!\n");  
                else  
                    output(max, min, max / min, '/');  
                return 0;  
            case '%':  
                output(max, min, max % min, '%');  
                return 0;  
        }  
    }  
    return 0;  
}  